package com.robot.base.common.api;

import com.qihang.annotations.ApiFactory;
import com.robot.base.model.CommentBean;
import com.robot.base.model.CourseAllTypeBean;
import com.robot.base.model.PageListBean;
import com.robot.base.model.ResourceBean;
import com.robot.base.model.ResourceDetailBean;
import com.robot.base.model.ResourceHomeBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseResponse;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

@ApiFactory(value = GlBaseApi.class)
public interface ResourceService {
    //资源分类
    @GET("/app-api/app/natural/allType")
    Observable<BaseResponse<List<CourseAllTypeBean>>> allType();

    //获得我的资源
    @GET("app-api/app/natural/getMyNatural")
    Observable<BaseResponse<PageListBean<ResourceBean>>> getMyNatural();

    //获得资源首页数据
    @GET("app-api/app/natural/homeData")
    Observable<BaseResponse<ResourceHomeBean>> homeData();

    //获得资源信息
    @GET("app-api/app/natural/getNaturalInfo")
    Observable<BaseResponse<ResourceDetailBean>> getNaturalInfo(@Query("id") String id);

    //获得资源信息分页
    @GET("app-api/app/natural/page")
    Observable<BaseResponse<PageListBean<ResourceBean>>> page(@QueryMap Map<String, Object> map);

    //评价资源
    @POST("app-api/app/natural/createNaturalComment")
    Observable<BaseResponse<String>> createNaturalComment(@Body Map<String, Object> map);

    //获得资源评价信息
    @GET("app-api/app/natural/getNaturalComment")
    Observable<BaseResponse<List<CommentBean>>> getNaturalComment(@Query("id") String id);

    //获得资源评价分页
    @GET("app-api/app/natural/pageComment")
    Observable<BaseResponse<PageListBean<CommentBean>>> pageComment(@QueryMap Map<String, Object> map);

    //添加收藏资源
    @POST("app-api/app/natural/saveCollectNatural")
    Observable<BaseResponse<String>> saveCollectNatural(@Body Map<String, Object> map);

    @POST("app-api/app/natural/createCommentLike")
    Observable<BaseResponse<String>> createCommentLike(@Body Map<String, Object> map);
}
